Goal:

The goal of this experiment was to create a gradient picture and to assign different cost values to areas of the map and turn the interaction off. This will see if the interaction is needed to create spatial phenotype correlations between newts and snakes.

Questions:

What does it mean to be correlated?

Background

Previously I have been looking at how newts and snakes can co-evolve under different genetic architectures (mutation rate and mutation effect size), and have found that while the mean phenotype increases there is no spatial phenotype correlation. This has puzzled me, so I added in an environment factor (cost gradient) and found that newt and snake mean phenotypes became spatially correlated.

Experiment

I created a simulation study to observe the co-evolutionary outcome of the newt-snake interaction with different genetic architectures (GAs) in a spatial setting. I hypothesized that we would see an interaction (co-evolutionary arms race) between newt and snake phenotype under some GA combinations when newts and snakes were evolving over geographical space. Each GA is paired with another GA creating 16 combinations.

GA1 experiment values:

I created a gradient map where at the top there is a higher fitness cost for having a large phenotype and at the bottom there is a lower cost for having a higher phenotype. Both newts and snakes are effected by this gradient. However, in this simulation I break the interaction between newts and snakes. Survival of the newt or snake depends on a coin flip and not their phenotype.

## All cor, lit, and grid files exist!
## This program will now end!

Mean Phenotype Whole Simulation

In this first section I look at the entire populations mean phenotype for both snakes (blue) and newts (red). The difference between mean snake and mean newt phenotype is shown on the black line. For each GA combination there are 4 sets of lines (red, blue, black). Each line is a different trial with the same simulation parameters. I also present the average difference (of the trials) between snake and newt phenotype in the table of average differences.

Phenotype differences

Table of average Differences

##                    Group.1           x
## 1  1e-08_0.005_1e-08_0.005  0.04221499
## 2   1e-08_0.005_1e-09_0.05  0.27113999
## 3    1e-08_0.005_1e-10_0.5  0.69590390
## 4      1e-08_0.005_1e-11_5  0.90478075
## 5   1e-09_0.05_1e-08_0.005 -0.02203734
## 6    1e-09_0.05_1e-09_0.05  0.24613755
## 7     1e-09_0.05_1e-10_0.5  0.35035589
## 8       1e-09_0.05_1e-11_5  1.12406062
## 9    1e-10_0.5_1e-08_0.005 -0.62984362
## 10    1e-10_0.5_1e-09_0.05 -0.13150747
## 11     1e-10_0.5_1e-10_0.5  0.19804547
## 12       1e-10_0.5_1e-11_5  0.28321807
## 13     1e-11_5_1e-08_0.005 -0.84263119
## 14      1e-11_5_1e-09_0.05 -0.98139355
## 15       1e-11_5_1e-10_0.5 -0.53854855
## 16         1e-11_5_1e-11_5  0.03315448

These results look very similar to the results seen in the simulation with no interaction and no gradient map. The mean phenotypes of newts and snakes go down, until they reach an equilibrium.

Connection between higher phenotype and population

Here I plot the interaction between newt/snake phenotype and population size. Typically, when a species had a higher phenotype they also had a larger population size. This relation between phenotype and population size had specific outcomes that depended on the GA of newts and snakes.

The first figure compares the population size of newts and snakes to the difference between mean snake and mean newt phenotype for a time slice (5,000-10,000 generations). Color in this plot is the difference between snake and newt phenotype, with blue indicating snakes have a larger phenotype and red indicating newts have a larger phenotype. Cream color points indicate that the two phenotypes are nearly the same. The second figure present the histograms of the difference between snake and newt population size (green) and phenotype (purple) for a time slice (5,000-10,000 generations).

Phenotype differences

Phenotype & Populationsize differences

These results are similar to what I have seen in the initial no interaction simulation. Higher phenotype does not equal more individuals, a lower GA mutational variance ends up having a higher phenotype.

Correlation

The next section I am examining the spatial correlation between newt and snake phenotypes and I predicted that there would be a positive correlation between the phenotypes. I first look at the correlation between mean newt phenotype and mean snake phenotype for each of the four trials in every GA combination from 10,000-15,000 generations. The solid line is a 0 with a dashed line at the level of correlation seen in natural newt-snake population(s).

There is no positive or negative spatail correlation. The spatial phenotype correlation is close to zero.

Correlation Histograms

In order to understand how spatial correlations where changing with time I took 5,000 generation time slices to look at all four trials correlation values. Each color is a different trial per GA combination. The histogram values are stacked.

Plot 1

Plot 2

Plot 3

Plot 4

Plot 5

Plot 6

Plot 7

Plot 8

Plot 9

Plot 10

The spatial phenotype correlation does not increase over time, it stays around zero (similar to the no interaction/cost gradient map).

Correlation across time

Next, I examine three randomly chosen plots. Time (in generations) in on the x-axis and both mean phenotype and phenotype spatial correlation in on the y-axis. Newt whole population mean phenotype is red, while snake mean phenotype is blue. The pink line is the phenotype spatial correlation.

Random 1

## [1] "pattern 1e-11_5_1e-08_0.005_3"
## [1] "Cor between average snake pheno and local cor -0.14819985639364"
## [1] "Cor between average newt pheno and local cor -0.354237057467953"
## [1] "Cor between average dif pheno and local cor -0.0699092662994254"
## [1] "Cor between newt pheno and snake 0.288764600988941"

Random 2

## [1] "pattern 1e-08_0.005_1e-11_5_0"
## [1] "Cor between average snake pheno and local cor 0.10903566072405"
## [1] "Cor between average newt pheno and local cor -0.026135542503478"
## [1] "Cor between average dif pheno and local cor 0.0619876179323381"
## [1] "Cor between newt pheno and snake -0.499778293610144"

Random 3

## [1] "pattern 1e-08_0.005_1e-11_5_2"
## [1] "Cor between average snake pheno and local cor 0.156944127621028"
## [1] "Cor between average newt pheno and local cor 0.260494449116469"
## [1] "Cor between average dif pheno and local cor -0.245685276892593"
## [1] "Cor between newt pheno and snake -0.0972116212239063"

The mean phenotypes of newt (red) and snake (blue) go down as the number of generations increase. The spatial correlation between newt and snake mean phenotype (pink) is randomly increasing and decreasing, but hanging out around zero.

What happens over time (looking at the beginning, middle, and late part of my simulations)

This next section is just getting a glimpse at how newt & snake phenotype and population size differ over time. The populations start off with about 250 individuals each. Each individual has a different genetic background created from msprime. Then each msprime simulation is put into slim and data is generated. Plots show newt by snake population size, with the point color representing the difference between mean snake and newt phenotype (red=newts have a higher phenotype and blue=snakes have a higher phenotype). The other plots show histograms of difference between snakes and newts phenotype and population size (purple and green).

Pheno Beginning

Pheno Middle

Pheno End

Dif Beginning

Dif Middle

Dif End

The results looked similar to results that I have seen in the other no interaction experiment. In the beginning of the simulation both newt and snake population grows. The difference in phenotype quickly becomes polarized (depending on GA). The population size reaches a steady point and then newts and snakes co-evolve. In the middle part of my simulation, the difference between newt and snakes mean phenotype solidifies. The histograms reflect what is seen in the scatter plots.

Summary

In the summary section, I try to come up with a way to show how different GA combinations can change the simulations results. In all of these plots snakes GA is represented by color and newt GA is represented by shape. There 16 color-shape combinations (with 4 repeats for trials). There are four sets of plots: 1) newt by snake population size, 2) phenotype difference by snake population size, 3) phenotype difference by snake GA, and 4) phenotype difference by newt GA. There are three figures in each set, taken at the begging, middle, and end time chunks.

Early-Sim Population Size Summary

Mid-Sim Population Size Summary

Late-Sim Population Size Summary

Early Difference Summary

Mid Difference Summary

Late Difference Summary

By Snake GA (Early)

By Snake GA (Mid)

By Snake GA (Late)

By Newt GA (Early)

By Newt GA (Mid)

By Newt GA (Late)

After examining these plots I found that there is no relationship between GA and population size or population size and phenotype. A higher newt mutational variance led to a lower newt phenotype (possibly pushed down due to cost and no interaction). These results are very similar to the no interaction/ no coat gradient simulation. It seems like the gradient map has little effect when the interaction of newt and snake is not dependent on phenotype. What if there was an interaction, but the rate was smaller?

Heatmap

In the heatmap plots each GA combination and trails is presented by combining newt GA in the x-axis to snake GA and trial number in the y-axis. The result is the color in that section. There are two types of heatmap plots shown below. One shows the average snake population size for a time chunk with darker colors indicating a smaller snake population and lighter colors indicating a larger snake population. The other heatmap shows the average difference between snake and newt mean phenotype (red=newts had a higher phenotype, blue=snakes had a higher phenotype). I look at 3 time slices for both types of heatmaps.

Population Size (Early)

Population Size (Mid)

Population Size (Late)

Phenotype (Early)

Phenotype (Mid)

Phenotype (Late)

The results of this section how that there is no relationship between GA and population size (colors seem random). There is relationship between GA and phenotype. Again, the difference in phenotype is symmetrical across the diagonal (right diagonal this time). Species have a higher phenotype is they have a GA with lower mutational variance. This might be due to the mutational effect size distribution and phenotype cost.

What is up with the correlations

This section goes over the results from the local measurements (grid calculations). I divided my map up into smaller area (grids) and calculated mean phenotype, max phenotype, min phenotype, and population size. In each of these plots newts are represented by circles and snakes are represented by squares. Parameter values increase from a dark color to a lighter color (green-blue themed for phenotype, orange-pinked themed for population size) There is also a subplot that plots each parameter (mean, max, …) of newt by snake colored by map location (red=corner, green=edge, blue=middle). I look at the one simulation at one time in the begging and end.

Early Simulation Correlation

Mean

## [1] 0.03546222

Max

## [1] -0.01682152

Min

## [1] 0.1004667

popsize

## [1] 0.4765142

Late Simulation Correlation

Mean

## [1] -0.1334463

Max

## [1] -0.02158262

Min

## [1] -0.07256572

Pop size

## [1] 0.4801903

Prototypes remain low so there is no spatial correlation.